Skip to content

chore: enable PIE (flake8-pie) ruff rule#5150

Open
ogulcanaydogan wants to merge 3 commits into
open-telemetry:mainfrom
ogulcanaydogan:chore/enable-ruff-pie-rule
Open

chore: enable PIE (flake8-pie) ruff rule#5150
ogulcanaydogan wants to merge 3 commits into
open-telemetry:mainfrom
ogulcanaydogan:chore/enable-ruff-pie-rule

Conversation

@ogulcanaydogan
Copy link
Copy Markdown

Part of #4227

Adds PIE to the ruff lint select list and fixes all violations.

What changed

  • pyproject.toml: added "PIE" to [tool.ruff.lint] select
  • Fixed 49 auto-fixable violations across 20 files:
    • PIE790 – removed unnecessary pass statements in exception handlers
    • PIE804 – replaced dict(key=value) with {"key": value} literals
    • PIE808 – removed redundant start=0 argument from range() calls
  • Added # noqa: PIE796 on GenAiTokenTypeValues.COMPLETION in gen_ai_attributes.py — this is an intentional deprecated alias sharing the same enum value as OUTPUT

Testing

ruff check .   # All checks passed

@github-project-automation github-project-automation Bot moved this to Approved PRs in Python PR digest Apr 27, 2026
@ogulcanaydogan
Copy link
Copy Markdown
Author

Thanks for the review @DylanRussell! Could a project member take a look when you have a moment? All checks are green.

@ogulcanaydogan
Copy link
Copy Markdown
Author

ogulcanaydogan commented May 1, 2026

Friendly bump @DylanRussell has approved and CI is green. Would appreciate a maintainer review when you have a moment. @srikanthccv @aabmass

@ogulcanaydogan ogulcanaydogan force-pushed the chore/enable-ruff-pie-rule branch 2 times, most recently from 261560f to 7b6dbb7 Compare May 8, 2026 11:05
@ogulcanaydogan ogulcanaydogan force-pushed the chore/enable-ruff-pie-rule branch 2 times, most recently from cac4933 to 8ea69ce Compare May 12, 2026 08:29
Part of open-telemetry#4227

Adds `PIE` to the ruff lint select list. Fixes all 49 auto-fixable
violations (PIE790 unnecessary pass, PIE804 unnecessary dict kwargs,
PIE808 unnecessary range start argument). Suppresses PIE796 on
GenAiTokenTypeValues.COMPLETION which is an intentional deprecated alias
for OUTPUT sharing the same enum value.
Signed-off-by: Ogulcan Aydogan <ogulcanaydogan@hotmail.com>
@ogulcanaydogan ogulcanaydogan force-pushed the chore/enable-ruff-pie-rule branch from 8ea69ce to 15a5193 Compare May 12, 2026 19:22
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

Status: Approved PRs

Development

Successfully merging this pull request may close these issues.

4 participants